#include "stdafx.h"

#include "MyControls/DeletePointTool.h"	  
#include "MyControls/BezierEditor.h"

namespace My {

DeletePointTool::DeletePointTool(BezierEditor & owner)
	: m_Owner(owner)
{
}

void DeletePointTool::Activate()
{
}

void DeletePointTool::Deactivate()
{
}

void DeletePointTool::PaintRect(CDC * pDC, const CRect &)
{
}

void DeletePointTool::OnLButtonDown(UINT nFlags, CPoint p)
{
	Size curve, node;
	if (m_Owner.NodeAt(p, curve, node)) {
		Bezier & b = m_Owner.GetBezierOwner()->GetBezier(curve);
		b.Deselect(node);
		b.Erase(node);
	}
}

void DeletePointTool::OnLButtonDblClk(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnLButtonUp(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnRButtonDown(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnRButtonDblClk(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnRButtonUp(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnMouseMove(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnMouseEnter(UINT nFlags, CPoint p)
{
}

void DeletePointTool::OnMouseLeave()
{
}

void DeletePointTool::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}

void DeletePointTool::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
}

bool DeletePointTool::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
	SetCursor(GetApp().LoadCursor("CURSOR_PEN_REMOVE"));
	return true;
}

} //namespace My
